import time
from datetime import datetime
dt1 = datetime.now()
time.sleep(6.7)
dt2 = datetime.now()

# BAD
print((dt2 - dt1).seconds)

# GOOD
print((dt2 - dt1).total_seconds())
# 精确到了毫秒
